﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.IO;

namespace teach
{
    public static class Constants
    {
        public static string FOLDER_RECOMPENSES_SHORT_VIDEOS = "VideosCourts";
        public static string FOLDER_RECOMPENSES_LONG_VIDEOS = "VideosLongs";
        public static string FOLDER_RECOMPENSES_IMAGES = "Images";

        public const string CONST_FOLDER_RESOURCES_QUESTION = "Questions";
        public const string CONST_FOLDER_RESOURCES_QUESTION_VIDEO = "Video";
        public const string CONST_FOLDER_RESOURCES_QUESTION_AUDIO = "Audio";
        public const string CONST_FOLDER_RESOURCES_QUESTION_IMAGES = "Images";
        public const string CONST_FOLDER_RESOURCES_USERS = "Users";
        public const string CONST_FOLDER_RESOURCES_PICS = "Pics";
        public const string CONST_FOLDER_BAD_ANSWERS = "MauvaisesReponses";
        public const string CONST_FOLDER_GOOD_ANSWERS = "BonnesReponses";
        public const string CONST_FILE_QUESTION_TYPES = "questionTypes.xml";
        public const string CONST_FILE_USERS = "users.xml";

        // ------- FOLDERS AND CONFIG ----------- //
        public static int HISTORY_MAX_DAYS = 2;
        public static string FOLDER_QUESTIONS = "";
        public static string FOLDER_QUESTIONS_VIDEO = "";
        public static string FOLDER_QUESTIONS_AUDIO = "";
        public static string FOLDER_QUESTIONS_IMAGES = "";
        public static string FOLDER_USERS = "";
        public static string FOLDER_BAD_ANSWERS = "";
        public static string FOLDER_GOOD_ANSWERS = "";
        public static string FOLDER_REWARDS_SHORT = "";
        public static string FOLDER_REWARDS_LONG = "";
        public static string FILE_QUESTIONS_TYPE = "";
        public static string FILE_USERS = "";
        public static string FOLDER_USERS_PIC = "";

        /// <summary>
        /// Initialize the folders and configuration
        /// </summary>
        public static void InitializeFolders()
        {
            string rootResources = prof.Properties.Settings.Default.FolderResources;
            string rootRecompenses = prof.Properties.Settings.Default.FolderRecompenses;
            HISTORY_MAX_DAYS = prof.Properties.Settings.Default.HistoryMaxDays;
            FOLDER_QUESTIONS = Path.Combine(rootResources, CONST_FOLDER_RESOURCES_QUESTION);
            FOLDER_USERS = Path.Combine(rootResources, CONST_FOLDER_RESOURCES_USERS);

            FILE_USERS = Path.Combine(FOLDER_USERS, CONST_FILE_USERS);
            FILE_QUESTIONS_TYPE = Path.Combine(FOLDER_QUESTIONS, CONST_FILE_QUESTION_TYPES);

            FOLDER_BAD_ANSWERS = Path.Combine(rootResources, CONST_FOLDER_BAD_ANSWERS);
            FOLDER_GOOD_ANSWERS = Path.Combine(rootResources, CONST_FOLDER_GOOD_ANSWERS);
            FOLDER_USERS_PIC = Path.Combine(FOLDER_USERS, CONST_FOLDER_RESOURCES_PICS);
            FOLDER_QUESTIONS_VIDEO = Path.Combine(FOLDER_QUESTIONS, CONST_FOLDER_RESOURCES_QUESTION_VIDEO);
            FOLDER_QUESTIONS_AUDIO = Path.Combine(FOLDER_QUESTIONS, CONST_FOLDER_RESOURCES_QUESTION_AUDIO);
            FOLDER_QUESTIONS_IMAGES = Path.Combine(FOLDER_QUESTIONS, CONST_FOLDER_RESOURCES_QUESTION_IMAGES);
            FOLDER_REWARDS_SHORT = Path.Combine(rootRecompenses, FOLDER_RECOMPENSES_SHORT_VIDEOS);
            FOLDER_REWARDS_LONG = Path.Combine(rootRecompenses, FOLDER_RECOMPENSES_LONG_VIDEOS);
        }
    }
}
